home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-12 | 10.2 KB | 373 lines | [TEXT/PJMM] |
- unit Icons;
-
- { Pascal Interface to the Macintosh Libraries }
-
- { Copyright © Apple Computer Inc. }
- { All Rights Reserved }
-
- { Adapted for use with THINK Pascal 4.0.x by Marco Piovanelli }
-
- interface
- uses
- Types;
-
- const
-
- { The following are icons for which there are both icon suites and SICNs. }
- genericDocumentIconResource = -4000;
- genericStationeryIconResource = -3985;
- genericEditionFileIconResource = -3989;
- genericApplicationIconResource = -3996;
- genericDeskAccessoryIconResource = -3991;
- genericFolderIconResource = -3999;
- privateFolderIconResource = -3994;
- floppyIconResource = -3998;
- trashIconResource = -3993;
- { The following are icons for which there are SICNs only. }
- desktopIconResource = -3992;
- openFolderIconResource = -3997;
- genericHardDiskIconResource = -3995;
- genericFileServerIconResource = -3972;
- genericSuitcaseIconResource = -3970;
- genericMoverObjectIconResource = -3969;
- { The following are icons for which there are icon suites only. }
- genericPreferencesIconResource = -3971;
- genericQueryDocumentIconResource = -16506;
- genericExtensionIconResource = -16415;
- systemFolderIconResource = -3983;
- appleMenuFolderIconResource = -3982;
-
- startupFolderIconResource = -3981;
- ownedFolderIconResource = -3980;
- dropFolderIconResource = -3979;
- sharedFolderIconResource = -3978;
- mountedFolderIconResource = -3977;
- controlPanelFolderIconResource = -3976;
- printMonitorFolderIconResource = -3975;
- preferencesFolderIconResource = -3974;
- extensionsFolderIconResource = -3973;
- fontsFolderIconResource = -3968;
- fullTrashIconResource = -3984;
- large1BitMask = 'ICN#';
- large4BitData = 'icl4';
- large8BitData = 'icl8';
- small1BitMask = 'ics#';
- small4BitData = 'ics4';
- small8BitData = 'ics8';
- mini1BitMask = 'icm#';
- mini4BitData = 'icm4';
- mini8BitData = 'icm8';
-
- { alignment type values }
- atNone = $0;
- atVerticalCenter = $1;
- atTop = $2;
- atBottom = $3;
- atHorizontalCenter = $4;
- atAbsoluteCenter = atVerticalCenter + atHorizontalCenter;
- atCenterTop = atTop + atHorizontalCenter;
- atCenterBottom = atBottom + atHorizontalCenter;
- atLeft = $8;
- atCenterLeft = atVerticalCenter + atLeft;
- atTopLeft = atTop + atLeft;
- atBottomLeft = atBottom + atLeft;
- atRight = $C;
- atCenterRight = atVerticalCenter + atRight;
- atTopRight = atTop + atRight;
- atBottomRight = atBottom + atRight;
-
-
- type
- IconAlignmentType = INTEGER;
-
- { transform type values }
-
- const
- ttNone = $0;
- ttDisabled = $1;
- ttOffline = $2;
- ttOpen = $3;
- ttLabel1 = $0100;
- ttLabel2 = $0200;
- ttLabel3 = $0300;
- ttLabel4 = $0400;
- ttLabel5 = $0500;
- ttLabel6 = $0600;
- ttLabel7 = $0700;
- ttSelected = $4000;
- ttSelectedDisabled = ttSelected + ttDisabled;
- ttSelectedOffline = ttSelected + ttOffline;
- ttSelectedOpen = ttSelected + ttOpen;
-
-
- type
- IconTransformType = INTEGER;
-
- { Selector mask values }
-
- const
- svLarge1Bit = $00000001;
- svLarge4Bit = $00000002;
- svLarge8Bit = $00000004;
- svSmall1Bit = $00000100;
- svSmall4Bit = $00000200;
- svSmall8Bit = $00000400;
- svMini1Bit = $00010000;
- svMini4Bit = $00020000;
- svMini8Bit = $00040000;
- svAllLargeData = $000000ff;
- svAllSmallData = $0000ff00;
- svAllMiniData = $00ff0000;
- svAll1BitData = svLarge1Bit + svSmall1Bit + svMini1Bit;
- svAll4BitData = svLarge4Bit + svSmall4Bit + svMini4Bit;
- svAll8BitData = svLarge8Bit + svSmall8Bit + svMini8Bit;
- svAllAvailableData = $ffffffff;
-
-
- type
- IconSelectorValue = LONGINT;
-
- IconActionProcPtr = ProcPtr; { FUNCTION IconAction(theType: ResType; VAR theIcon: Handle; yourDataPtr: UNIV Ptr): OSErr; }
- IconActionUPP = UniversalProcPtr;
-
- const
- uppIconActionProcInfo = $00000FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 2 byte result; }
-
- function NewIconActionProc (userRoutine: IconActionProcPtr): IconActionUPP;
- inline
- $2E9F;
-
- function CallIconActionProc (theType: ResType;
- var theIcon: Handle;
- yourDataPtr: univ Ptr;
- userRoutine: IconActionUPP): OSErr;
- inline
- $205F, $4E90;
-
- type
- IconAction = IconActionUPP;
-
- IconGetterProcPtr = ProcPtr; { FUNCTION IconGetter(theType: ResType; yourDataPtr: UNIV Ptr): Handle; }
- IconGetterUPP = UniversalProcPtr;
-
- const
- uppIconGetterProcInfo = $000003F0; { FUNCTION (4 byte param, 4 byte param): 4 byte result; }
-
- function NewIconGetterProc (userRoutine: IconGetterProcPtr): IconGetterUPP;
- inline
- $2E9F;
-
- function CallIconGetterProc (theType: ResType;
- yourDataPtr: univ Ptr;
- userRoutine: IconGetterUPP): Handle;
- inline
- $205F, $4E90;
-
- type
- IconGetter = IconGetterUPP;
-
- CIcon = record
- iconPMap: PixMap; {the icon's pixMap}
- iconMask: BitMap; {the icon's mask}
- iconBMap: BitMap; {the icon's bitMap}
- iconData: Handle; {the icon's data}
- iconMaskData: array[0..0] of INTEGER; {icon's mask and BitMap data}
- end;
- CIconPtr = ^CIcon;
- CIconHandle = ^CIconPtr;
-
-
- function GetCIcon (iconID: INTEGER): CIconHandle;
- inline
- $AA1E;
- procedure PlotCIcon ({CONST}
- var theRect: Rect;
- theIcon: CIconHandle);
- inline
- $AA1F;
- procedure DisposeCIcon (theIcon: CIconHandle);
- inline
- $AA25;
- function GetIcon (iconID: INTEGER): Handle;
- inline
- $A9BB;
- procedure PlotIcon ({CONST}
- var theRect: Rect;
- theIcon: Handle);
- inline
- $A94B;
-
- function PlotIconID ({CONST}
- var theRect: Rect;
- align: IconAlignmentType;
- transform: IconTransformType;
- theResID: INTEGER): OSErr;
- inline
- $303C, $0500, $ABC9;
- function NewIconSuite (var theIconSuite: Handle): OSErr;
- inline
- $303C, $0207, $ABC9;
- function AddIconToSuite (theIconData: Handle;
- theSuite: Handle;
- theType: ResType): OSErr;
- inline
- $303C, $0608, $ABC9;
- function GetIconFromSuite (var theIconData: Handle;
- theSuite: Handle;
- theType: ResType): OSErr;
- inline
- $303C, $0609, $ABC9;
- function ForEachIconDo (theSuite: Handle;
- selector: IconSelectorValue;
- action: IconActionUPP;
- yourDataPtr: univ Ptr): OSErr;
- inline
- $303C, $080A, $ABC9;
- function GetIconSuite (var theIconSuite: Handle;
- theResID: INTEGER;
- selector: IconSelectorValue): OSErr;
- inline
- $303C, $0501, $ABC9;
- function DisposeIconSuite (theIconSuite: Handle;
- disposeData: BOOLEAN): OSErr;
- inline
- $303C, $0302, $ABC9;
- function PlotIconSuite ({CONST}
- var theRect: Rect;
- align: IconAlignmentType;
- transform: IconTransformType;
- theIconSuite: Handle): OSErr;
- inline
- $303C, $0603, $ABC9;
- function MakeIconCache (var theHandle: Handle;
- makeIcon: IconGetterUPP;
- yourDataPtr: univ Ptr): OSErr;
- inline
- $303C, $0604, $ABC9;
- function LoadIconCache ({CONST}
- var theRect: Rect;
- align: IconAlignmentType;
- transform: IconTransformType;
- theIconCache: Handle): OSErr;
- inline
- $303C, $0606, $ABC9;
- function PlotIconMethod ({CONST}
- var theRect: Rect;
- align: IconAlignmentType;
- transform: IconTransformType;
- theMethod: IconGetterUPP;
- yourDataPtr: univ Ptr): OSErr;
- inline
- $303C, $0805, $ABC9;
- function GetLabel (labelNumber: INTEGER;
- var labelColor: RGBColor;
- var labelString: Str255): OSErr;
- inline
- $303C, $050B, $ABC9;
- function PtInIconID (testPt: Point; {CONST}
- var iconRect: Rect;
- align: IconAlignmentType;
- iconID: INTEGER): BOOLEAN;
- inline
- $303C, $060D, $ABC9;
- function PtInIconSuite (testPt: Point; {CONST}
- var iconRect: Rect;
- align: IconAlignmentType;
- theIconSuite: Handle): BOOLEAN;
- inline
- $303C, $070E, $ABC9;
- function PtInIconMethod (testPt: Point; {CONST}
- var iconRect: Rect;
- align: IconAlignmentType;
- theMethod: IconGetterUPP;
- yourDataPtr: univ Ptr): BOOLEAN;
- inline
- $303C, $090F, $ABC9;
- function RectInIconID ({CONST}
- var testRect: Rect; {CONST}
- var iconRect: Rect;
- align: IconAlignmentType;
- iconID: INTEGER): BOOLEAN;
- inline
- $303C, $0610, $ABC9;
- function RectInIconSuite ({CONST}
- var testRect: Rect; {CONST}
- var iconRect: Rect;
- align: IconAlignmentType;
- theIconSuite: Handle): BOOLEAN;
- inline
- $303C, $0711, $ABC9;
- function RectInIconMethod ({CONST}
- var testRect: Rect; {CONST}
- var iconRect: Rect;
- align: IconAlignmentType;
- theMethod: IconGetterUPP;
- yourDataPtr: univ Ptr): BOOLEAN;
- inline
- $303C, $0912, $ABC9;
- function IconIDToRgn (theRgn: RgnHandle; {CONST}
- var iconRect: Rect;
- align: IconAlignmentType;
- iconID: INTEGER): OSErr;
- inline
- $303C, $0613, $ABC9;
- function IconSuiteToRgn (theRgn: RgnHandle; {CONST}
- var iconRect: Rect;
- align: IconAlignmentType;
- theIconSuite: Handle): OSErr;
- inline
- $303C, $0714, $ABC9;
- function IconMethodToRgn (theRgn: RgnHandle; {CONST}
- var iconRect: Rect;
- align: IconAlignmentType;
- theMethod: IconGetterUPP;
- yourDataPtr: univ Ptr): OSErr;
- inline
- $303C, $0915, $ABC9;
- function SetSuiteLabel (theSuite: Handle;
- theLabel: INTEGER): OSErr;
- inline
- $303C, $0316, $ABC9;
- function GetSuiteLabel (theSuite: Handle): INTEGER;
- inline
- $303C, $0217, $ABC9;
- function GetIconCacheData (theCache: Handle;
- theData: univ Ptr): OSErr;
- inline
- $303C, $0419, $ABC9;
- function SetIconCacheData (theCache: Handle;
- theData: univ Ptr): OSErr;
- inline
- $303C, $041A, $ABC9;
- function GetIconCacheProc (theCache: Handle;
- var theProc: IconGetterUPP): OSErr;
- inline
- $303C, $041B, $ABC9;
- function SetIconCacheProc (theCache: Handle;
- theProc: IconGetterUPP): OSErr;
- inline
- $303C, $041C, $ABC9;
- function PlotIconHandle ({CONST}
- var theRect: Rect;
- align: IconAlignmentType;
- transform: IconTransformType;
- theIcon: Handle): OSErr;
- inline
- $303C, $061D, $ABC9;
- function PlotSICNHandle ({CONST}
- var theRect: Rect;
- align: IconAlignmentType;
- transform: IconTransformType;
- theSICN: Handle): OSErr;
- inline
- $303C, $061E, $ABC9;
- function PlotCIconHandle ({CONST}
- var theRect: Rect;
- align: IconAlignmentType;
- transform: IconTransformType;
- theCIcon: CIconHandle): OSErr;
- inline
- $303C, $061F, $ABC9;
-
- implementation
- end.